#ifndef __VIEW_RENDER_H
#define __VIEW_RENDER_H

#include <driver/view/view.h>
#include <driver/view/bitmap.h>
#include <driver/view/screen.h>
#include <lib/stdint.h>
#include <lib/stddef.h>

#define ViewRenderPutPixelFast(view, x, y, color)                   \
    do                                                              \
    {                                                               \
        view_color_t *buff = (view_color_t *)(view)->section->addr; \
        buff[(y) * (view)->width + (x)] = (color);                  \
    } while (0)

void ViewRenderHline(view_t *view, int y, int x0, int x1, view_color_t color);
void ViewRenderVline(view_t *view, int x, int y1, int y2, view_color_t color);
int ViewRenderClear(view_t *view);
int ViewRenderGetPixel(view_t *view, int x, int y, view_color_t *color);
int ViewRenderPutPixel(view_t *view, int x, int y, view_color_t color);

void ViewRenderLine(view_t *view, int x1, int y1, int x2, int y2, view_color_t color);
int ViewRenderRectEx(view_t *view, int x1, int y1, int x2, int y2, view_color_t color);
void ViewRenderRectfill(view_t *view, int x, int y, uint32_t width, uint32_t height, view_color_t color);
int ViewRenderRectfillEx(view_t *view, int x1, int y1, int x2, int y2, view_color_t color);
int ViewRenderRect(view_t *view, int x, int y, uint32_t width, int height, view_color_t color);
int ViewRenderDrawShade(view_t *shade, view_rect_t *rect, int draw);
int ViewRenderBitblt(view_t *view, int x, int y, view_bitmap_t *bmp, int bx, int by, int width, int height);

#endif